/**
 * Created by mantoo on 2017/10/7.
 */
var myChart = echarts.init(document.getElementById('main_demo'));


option = {
    title : {
        text: '就业岗位数量南丁格尔图',
        subtext: '前10名',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        x : 'center',
        y : 'bottom',
        data:[]
    },
    toolbox: {
        show : true,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {
                show: true,
                type: ['pie', 'funnel']
            },
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    series : [
        {
            name:'半径模式',
            type:'pie',
            radius : [20, 110],
            center : ['25%', '50%'],
            roseType : 'radius',
            label: {
                normal: {
                    show: false
                },
                emphasis: {
                    show: true
                }
            },
            lableLine: {
                normal: {
                    show: false
                },
                emphasis: {
                    show: true
                }
            },
            data:[ ]
        },
        {
            name:'面积模式',
            type:'pie',
            radius : [30, 110],
            center : ['75%', '50%'],
            roseType : 'area',
            data:[
                {value:10, name:'rose1'},
                {value:5, name:'rose2'},
                {value:15, name:'rose3'},
                {value:25, name:'rose4'},
                {value:20, name:'rose5'},
                {value:35, name:'rose6'},
                {value:30, name:'rose7'},
                {value:40, name:'rose8'}
            ]
        }
    ]
};
  var i = 0;
  for (key in Message){
      option.legend.data[i]=key;
      option.series[0].data[i] = {};
      option.series[0].data[i]['value']=Message[key];
      option.series[0].data[i]['name']=key;

      option.series[1].data[i] = {};
      option.series[1].data[i]['value']=Message[key];
      option.series[1].data[i]['name']=key;
      i++;
    }
myChart.setOption(option);